export const getToken = () => {
  const cache_token = uni.getStorageSync("token");
  return cache_token;
};

export const setToken = (token) => uni.setStorageSync("token", token);

export const clearToken = () => {
  uni.removeStorageSync("token");
  uni.removeStorageSync("loginType");
};

export const setLoginType = (type) => uni.setStorageSync("loginType", type);
export const getLoginType = () => uni.getStorageSync("loginType");

export const setSupplierRoles = (roles) => uni.setStorageSync("supplierRoles", JSON.stringify(roles));
export const getSupplierRoles = () => JSON.parse(uni.getStorageSync("supplierRoles"));
